const validateRID = (rule, value, callback) => {
  if (value < 0 || value > 15)
    return callback(new Error("角色ID取值范围为0~15"));
  callback();
};

export default {
  rid: [{
      required: true,
      message: "请输入角色ID",
      trigger: "blur"
    },
    {
      type: "number",
      message: "角色ID必须为数字",
      trigger: "blur"
    },
    {
      validator: validateRID,
      trigger: "blur"
    }
  ],
  title: [{
      required: true,
      message: "请输入角色名称",
      trigger: "blur"
    },
    {
      min: 2,
      max: 12,
      message: "角色名称长度为2~12位",
      trigger: "blur"
    }
  ]
}
